<template>
  <div>
     <ul>
       <li v-for="(value,index) in titles" @click="change(index)" :class="{'active':index==activeIndex}">{{value}}</li>
     </ul>
  </div>
</template>

<script>
  export default{
    name:'',
    data(){
      return {
          activeIndex:0
       }
    },
    props:{
      titles:{
        type:Array,
        default(){
          return []
        }
      }
    },
    methods:{
      change(i){
        this.activeIndex=i
        this.$emit("changeIndex",i)
      }
    },
    components:{

    }
  }
</script>

<style scoped>
  ul{
    text-decoration: none;
    text-align: center;
    background-color: #f1f1f1;
    width: 12vh;
    display: flex;
    flex-direction: column;
  }
  li{
    border-bottom: 0.5px solid #b9b9b9;
    height: 10vh;
    line-height: 10vh;
  }
  ul>li:nth-last-child(1){
    border-bottom: 0px solid #b9b9b9;
  }
  .active{
    color: #FF4500;
  }
</style>
